<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center anjianliebiao_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub anjianliebiao_fd0_0'>
					<view class='flex flex-wrap align-center anjianliebiao_fd0_0_c0' @click="goindex">
						<text class='fu-iconfont2  anjianliebiao_fd0_0_c0_c0'>&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='anjianliebiao_fd0_0_c1_c0'>案件列表</text>
					</view>
					<view class='flex flex-wrap align-center justify-end anjianliebiao_fd0_0_c0'>
					</view>
				</view>
			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex benben-flex-layout flex-wrap align-center anjianliebiao_flex_1">
				<view class="one_header">
					<view class="one_header_list" :class="{'one_header_list_now':sxopenindex ===1}" @click="opensxclick(1)">
						<text v-if="citytext==''">地区</text>
						<text v-else>{{citytext}}</text>
						<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images//69.png" mode=""></image>
					</view>
					<view class="one_header_list" :class="{'one_header_list_now':sxopenindex ===2}"  @click="opensxclick(2)">
						<text v-if="timetext==''">时间</text>
						<text v-else>{{timetext}}</text>
						<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images//69.png" mode=""></image>
					</view>
					<view class="one_header_list" :class="{'one_header_list_now':sxopenindex ===3}" @click="opensxclick(3)">
						<text v-if="leibietext==''">类别</text>
						<text v-else>{{leibietext}}</text>
						<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/69.png" mode=""></image>
					</view>
					<view class="one_header_list" :class="{'one_header_list_now':sxopenindex ===4}" @click="opensxclick(4)">
						<text v-if="pricename==''">价格</text>
						<text v-else>{{pricename}}</text>
						<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/69.png" mode=""></image>
					</view>
				</view>
				<view class='flex flex-wrap align-center anjianliebiao_fd1_0'>
					<template v-for='(item,key0) in get_cases_list'>
						<view class='flex flex-wrap align-center anjianliebiao_fd1_0_c0' @tap.stop="handleJumpDiy"
							data-type="navigateTo"
							:data-url="`/pages/shouye/anjiandetail/anjiandetail?anjianid=${item.aid}`" :key='key0'>
							<view class='flex align-stretch justify-around anjianliebiao_fd1_0_c0_c0'>
								<view class='flex flex-wrap align-center' style="width: 25%;">
									<text class='anjianliebiao_fd1_0_c0_c0_c0_c0'>{{item.suozaidiqu_city}}</text>
								</view>
								<view class='flex flex-wrap align-center' style="width: 25%;">
									<text class='anjianliebiao_fd1_0_c0_c0_c0_c0'>{{item.create_time}}</text>
								</view>
								<view class='align-center' style="width: 20%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;line-height: 76rpx;">
									<text class='anjianliebiao_fd1_0_c0_c0_c0_c0'>{{item.servicecate_mingcheng}}</text>
								</view>
								<view class='flex flex-wrap align-center newlist'>
									<text class='anjianliebiao_fd1_0_c0_c0_c0_c0'>{{item.price}}</text>
									<text>元</text>
									<view class='flex flex-wrap align-center anjianliebiao_fd1_0_c0_c0_c2_c0'
										v-if=" item.fuwujiageleixing=='1'">
										<text class='anjianliebiao_fd1_0_c0_c0_c2_c0_c0'>一口价</text>
									</view>
									<view class='flex flex-wrap align-center anjianliebiao_fd1_0_c0_c0_c2_c1'
										v-if=" item.fuwujiageleixing=='2'">
										<text class='anjianliebiao_fd1_0_c0_c0_c2_c0_c0'>全风险</text>
									</view>
									<view class='flex flex-wrap align-center anjianliebiao_fd1_0_c0_c0_c2_c2'
										v-if=" item.fuwujiageleixing=='3'">
										<text class='anjianliebiao_fd1_0_c0_c0_c2_c0_c0'>半风险</text>
									</view>
								</view>
							</view>
						</view>
					</template>
					<fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
						:listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
				</view>
			</view>
		</view>
		
		<view class="sx_mb" v-if="sxshow">
			<view class="sx_content">
				<view class="sx_header" @click="sxshow=false">
					<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/69.png" mode=""></image>
					<text>案件列表</text>
				</view>
				<view class="sx_header_two">
					<view class="one_header_list" :class="{'one_header_list_now':sxopenindex ===1}" @click="opensxclick(1)">
						<text v-if="citytext==''">地区</text>
						<text v-else>{{citytext}}</text>
						<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/69.png" mode=""></image>
					</view>
					<view class="one_header_list" :class="{'one_header_list_now':sxopenindex ===2}"  @click="opensxclick(2)">
						<text v-if="timetext==''">时间</text>
						<text v-else>{{timetext}}</text>
						<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/69.png" mode=""></image>
					</view>
					<view class="one_header_list" :class="{'one_header_list_now':sxopenindex ===3}" @click="opensxclick(3)">
						<text v-if="leibietext==''">类别</text>
						<text v-else>{{leibietext}}</text>
						<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/69.png" mode=""></image>
					</view>
					<view class="one_header_list" :class="{'one_header_list_now':sxopenindex ===4}" @click="opensxclick(4)">
						<text v-if="pricename==''">价格</text>
						<text v-else>{{pricename}}</text>
						<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/69.png" mode=""></image>
					</view>
				</view>
				<view class="sx_header_three">
					<!-- 地区 -->
					<view class="sx_header_three_one" v-if="sxopenindex==1">
						<view class="sx_header_three_one_l">
							<view class="sx_header_three_one_l_list" v-for="item in povicelist" :class="{'sx_header_three_one_l_list_now':poviceid==item.id}" @click="poviceclick(item)">
								<text>{{item.name}}</text>
							</view>
						</view>
						<view class="sx_header_three_one_r">
							<view class="sx_header_three_one_l_list " v-for="item in citylist" :class="{'sx_header_three_one_l_list_now':cityid==item.id}" @click="cityclick(item)">
								<text>{{item.name}}</text>
								<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/70.png" mode="" v-if="cityid==item.id"></image>
							</view>
						</view>
					</view>
					<!-- 时间 -->
					<view class="sx_header_three_one" style="text-align: center;" v-if="sxopenindex==2">
						<view class="sx_header_three_one_l_list" :class="{'sx_header_three_one_l_list_now':timetext == item}" v-for="(item,index) in timelist" @click="timeclick(index,item)">
							<text>{{item}}</text>
							<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/70.png" mode="" v-if="timetext == item"></image>
						</view>
					</view>
					<!-- 类别 -->
					<view class="sx_header_three_one" style="text-align: center;"v-if="sxopenindex==3">
						<view class="sx_header_three_one_l_list " v-for="item in leibielist" :class="{'sx_header_three_one_l_list_now':leibietext==item.mingcheng}" @click="leibieclick(item)">
							<text>{{item.mingcheng}}</text>
							<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/70.png" mode="" v-if="leibietext==item.mingcheng"></image>
						</view>
					</view>
					<!-- 价格 -->
					<view class="sx_header_three_one" style="text-align: center;"v-if="sxopenindex==4">
						<view class="sx_header_three_price">
							<view class="sx_header_three_price_one">
								<input type="digit" maxlength="6" placeholder="请输入最低价格" v-model="price1" @input="pricechange"/>
							</view>
							<text class="sx_header_three_price_text">至</text>
							<view class="sx_header_three_price_one">
								<input type="digit" maxlength="6" placeholder="请输入最高价格" v-model="price2" @input="pricechange" />
							</view>
						</view>
						<view class="sx_header_three_one_l_list " v-for="item in pricelist" :class="{'sx_header_three_one_l_list_now':item.name==pricename}" @click="priceclick(item)">
							<text>{{item.name}}</text>
							<image src="https://paiaifalv.oss-cn-beijing.aliyuncs.com/images/70.png" mode="" v-if="item.name==pricename"></image>
						</view>
					</view>
				</view>
				<view class="sx_header_four">
					<view class="sx_header_four_l" @click="canceclick">
						<text>重置</text>
					</view>
					<view class="sx_header_four_r" @click="canfiremclick">
						<text>确定</text>
					</view>
				</view>
			</view>
			
		</view>
		
	</view>
</template>
<script>
	import pagingList from '@/common/mixin/paging_list.js';
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},
		mixins: [pagingList],

		data() {
			return {
				"minixPagingListsApi": "",
				"pageingListApiMethod": "",
				"allowOnloadGetList": false,
				"suozaidiqu_province": "",
				"suozaidiqu_city": "",
				"servicecate_id": "",
				"price1": "",
				"date": "",
				"page": "1",
				"list_rows": "15",
				"price2": "",
				"get_cases_list": [],
				sxshow:false,//筛选状态
				sxopenindex:"1",//筛选当前状态
				povicelist:[],//省市列表
				poviceid:"",//省id
				povicetext:"",//省名称
				citylist:[],//市列表
				cityid:"",//城市ID
				citytext:"",//市名称
				timelist:[],//筛选时间
				timetext:"",//时间选择的汉字
				timeindex:"",//时间下标
				leibielist:[],//类别list
				leibietext:"",//类别汉字
				leibieid:"",//类别ID
				pricelist:[],//价格列表
				pricename:"",//价格名称
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.citytext = options.cityname;
			this.post65e6fde9dfaea();//获取省市区
			this.getdp65ba149821f26Func();//案件列表
			this.gettime();//获取时间
			this.getleibie();//获取类别
			this.getprice();//筛选价格
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			goindex(){
				uni.switchTab({
					url:"/pages/tabBar/shouye/shouye"
				})
			},
			
			//获取省市区
			post65e6fde9dfaea(){
				let _this = this;
				this.$api.post(global.apiUrls.post65e6fde9dfaea, {
				}).then(res=>{
					if(res.data.code==1){
						_this.povicelist = res.data.data;
					}
				})
			},
			
			//省点击事件
			poviceclick(item){
				this.poviceid = item.id;
				this.povicetext = item.name;
				this.getcity();
			},
			
			//获取市
			getcity(){
				this.$api.post(global.apiUrls.post65e6fde9dfaea, {
					pid:this.poviceid,
				}).then(res=>{
					if(res.data.code==1){
						this.citylist = res.data.data;
					}
				})
			},
			
			//市点击事件
			cityclick(item){
				this.cityid = item.id;
				this.citytext = item.name;
				// if(item.name=='市辖区'){
				// 	this.citytext = this.povicetext;
				// }else{
				// 	this.citytext = item.name;
				// }
			},
			
			//获取筛选时间
			gettime(){
				this.$api.post(global.apiUrls.post65bb13979b388, {
				}).then(res=>{
					if(res.data.code==1){
						this.timelist = res.data.data;
					}
				})
			},
			
			//时间选择
			timeclick(index,item){
				this.timetext = item;
				this.timeindex = index;
			},
			
			//获取类别
			getleibie(){
				this.$api.post(global.apiUrls.post65e6fa45e9cc1, {
					
				}).then(res=>{
					if(res.data.code==1){
						this.leibielist = res.data.data;
					}
				})
			},
			
			//类别选择事件
			leibieclick(item){
				this.leibietext = item.mingcheng;
				this.leibieid = item.aid;
			},
			
			//获取价格
			getprice(){
				this.$api.post(global.apiUrls.post65bb14a8dc755, {
					
				}).then(res=>{
					if(res.data.code==1){
						this.pricelist = res.data.data;
					}
				})
			},
			
			//价格选择时间
			priceclick(item){
				this.pricename = item.name;
				this.price1 = item.price1;
				this.price2 = item.price2;
			},
			
			//价格填写时间
			pricechange(){
				this.pricename = "";
			},
			
			//打开筛选弹窗
			opensxclick(index){
				this.sxopenindex = index;
				this.sxshow = true;
			},
			
			//确定事件
			canfiremclick(){
				this.sxshow = false;
				this.getdp65ba149821f26Func();
			},
			
			//重置事件
			canceclick(){
				this.poviceid = "";
				this.povicetext = "";
				this.cityid = "";
				this.citytext = "";
				this.timetext = "";
				this.timeindex = "";
				this.leibietext = "";
				this.leibieid = "";
				this.pricename = "";
				this.price1 = "";
				this.price2 = "";
				this.sxshow = false;
				this.getdp65ba149821f26Func();
			},
			
			//查询案件列表S
			getdp65ba149821f26Func() {
				this.minixPagingListsApi = global.apiUrls.post65ba149821f26;
				this.pageingListApiMethod = 'post';
				this.allowOnloadGetList = false;
				this.pagingListPostDataContent = {
					suozaidiqu_province: this.povicetext,
					suozaidiqu_city: this.citytext,
					servicecate_id: this.leibieid,
					price1: this.price1,
					date: this.timeindex,
					price2: this.price2
				}
				this.listData = [];
				this.get_cases_list = this.listData;
				this.pagingListToggle();

			},
			pagingListPostData() {
				return this.pagingListPostDataContent
			},
			
			
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.anjianliebiao_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.anjianliebiao_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.anjianliebiao_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.anjianliebiao_fd0_0_c0 {
		width: 120rpx;
	}

	.anjianliebiao_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.anjianliebiao_flex_1 {
		background: #fff;
		width: 100%;
		background-size: 100% auto;
	}

	.anjianliebiao_fd1_0_c0_c0_c2_c2 {
		background: #E9B404;
		border-radius: 4rpx;
		height: 36rpx;
	}

	.anjianliebiao_fd1_0_c0_c0_c2_c1 {
		background: #FD0100;
		border-radius: 2rpx 2rpx 2rpx 2rpx;
		height: 36rpx;
	}

	.anjianliebiao_fd1_0_c0_c0_c2_c0_c0 {
		color: #FFFFFF;
		font-size: 24rpx;
		padding: 0 4rpx 0 4rpx;
	}
	.newlist{
		width:28%;
	}
	.anjianliebiao_fd1_0_c0_c0_c2_c0 {
		background: #01BF85;
		border-radius: 4rpx;
		height: 36rpx;
	}

	.anjianliebiao_fd1_0_c0_c0_c0_c0 {
		color: #000000;
		font-size: 28rpx;
		font-weight: 400;
	}

	.anjianliebiao_fd1_0_c0_c0 {
		border-bottom: 1px solid rgba(242, 242, 242, 1);
		width: 750rpx;
		height: 76rpx;
	}

	.anjianliebiao_fd1_0_c0 {
		border-bottom: 1px solid #eee;
		width: 100%;
	}

	.anjianliebiao_fd1_0 {
		width: 100%;
	}
	.one_header{
		width: 100%;
		height: 90rpx;
		background: #FFFFFF;
		box-shadow: 0px 3rpx 6rpx 1rpx rgba(0,0,0,0.1);
	}
	.one_header_list{
		width: 25%;
		height: 100%;
		float: left;
		line-height: 90rpx;
		text-align: center;
	}
	.one_header_list image{
		 width: 28rpx;
		 height: 24rpx;
		 transform: rotate(180deg);
		 margin-left: 10rpx;
		 position: relative;
		 top: 4rpx;
	 }
	 .one_header_list_now{
		 color: #26BF01;
	 }
	 .sx_mb{
		 width: 100%;
		 height: 100%;
		 position: fixed;
		 left: 0;
		 top: 0;
		 background-color: rgba(0, 0, 0, 0.5);
		 z-index: 999;
	 }
	 .sx_content{
		 width: 100%;
		 padding-top: 120rpx;
		 overflow: hidden;
		 background-color: #fff;
	 }
	 .sx_header{
		 width: 100%;
		 height: 88rpx;
		 line-height: 88rpx;
		 text-align: center;
		 font-weight: 400;
		 font-size: 36rpx;
		 color: #1A1A1A;
		 position: relative;
		 border-bottom: 1rpx solid #EFEFEF;
	 }
	 .sx_header image{
		 width: 32rpx;
		 height: 32rpx;
		 transform: rotate(-90deg);
		 position: absolute;
		 left: 32rpx;
		 top: 30rpx;
	 }
	 .sx_header_two{
		 width: 100%;
		 overflow: hidden;
	 }
	 .sx_header_three{
		 width: 100%;
		 height: 500rpx;
		  border-bottom: 1rpx solid #EFEFEF;
	 }
	 .sx_header_three_one{
		 width: 100%;
		 height: 100%;
		 overflow-y: scroll;
	 }
	 .sx_header_three_one_l{
		 width: 350rpx;
		 height: 100%;
		 overflow-y: scroll;
		 float: left;
	 }
	 .sx_header_three_one_l_list{
		 width: 100%;
		 height: 80rpx;
		 font-weight: 400;
		 font-size: 28rpx;
		 color: #000000;
		 text-indent: 38rpx;
		 line-height: 80rpx;
		 position: relative;
	 }
	 .sx_header_three_one_l_list_now{
		 background: #E2EFDF;
		 font-weight: 400;
		 color: #26BF01;
	 }
	 .sx_header_three_one_r{
		 width: 400rpx;
		 height: 100%;
		 overflow-y: scroll;
		 float: right;
	 }
	 .sx_header_three_one_l_list image{
		 width: 30rpx;
		 height: 30rpx;
		 position: absolute;
		 right: 32rpx;
		 top: 25rpx;
	 }
	 .sx_header_time_list{
		 width: 100%;
		 height: 80rpx;
		 font-weight: 400;
		 font-size: 28rpx;
		 color: #000000;
		 text-align: center;
		 line-height: 80rpx;
	 }
	 .sx_header_three_price{
		 width: 702rpx;
		 height: 80rpx;
		 margin: 24rpx auto;
	 }
	 .sx_header_three_price_one{
		 width: 300rpx;
		 height: 100%;
		 float: left;
	 }
	 .sx_header_three_price_one input{
		 background: #EFEFEF;
		 border-radius: 16px;
		 height: 100%;
	 }
	 .sx_header_three_price_text{
		 font-weight: 400;
		 font-size: 28rpx;
		 color: #BBBBBB;
		 display: block;
		 float: left;
		 margin-left: 36rpx;
		 margin-right:36rpx;
		 margin-top: 24rpx;
	 }
	 .sx_header_four{
		 width: 100%;
		 height: 106rpx;
		 text-align: center;
		 line-height: 106rpx;
	 }
	 .sx_header_four_l{
		 width: 374rpx;
		 height: 100%;
		 float: left;
		 border-right: 1rpx solid #eee;
		 font-weight: 400;
		 font-size:28rpx;
		 color: #333333;
	 }
	 .sx_header_four_r{
		 width: 374rpx;
		 height: 100%;
		 float: left;
		 font-weight: 400;
		 font-size:28rpx;
		color: #26BF01;
	 }
</style>